import store from "@/store";
import dayjs from "dayjs";
console.log(88);
export const formItemStyle = {
  paddingLeft: "20px",
};

export const cellStyle = {
  background: "rgba(28, 155, 252, 0.02)",
  color: "rgb(142, 155, 185)",
  textAlign: "center",
};

// 表头单元格样式
export const headerCellStyle = {
  background: "rgba(28, 155, 252, 0.02)",
  color: "rgb(142, 155, 185)",
  textAlign: "center",
};

// 表格内表单子样式
export const tableFormStyle = {
  marginBottom: 0,
};
export const formBase = [
  {
    label: "订单日期",
    type: "daterange",
    field: "shelfTime",
    prop: "shelfTime",
    required: true,
    otherOptions: {
      disabled: false,
      rangeSeparator: "至",
      startPlaceholder: "开始日期",
      endPlaceholder: "结束日期",
      pickerOptions: {
        shortcuts: [
          {
            text: "今天",
            onClick(picker) {
              const end = dayjs().format("YYYY-MM-DD 23:59:59");
              const start = dayjs().format("YYYY-MM-DD 00:00:00");
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "昨天",
            onClick(picker) {
              const end = new Date(dayjs().format("YYYY-MM-DD 23:59:59"));
              const start = new Date(dayjs().format("YYYY-MM-DD 00:00:00"));
              end.setTime(start.getTime() - 3600 * 1000 * 24);
              start.setTime(start.getTime() - 3600 * 1000 * 24);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近三天",
            onClick(picker) {
              const end = new Date(dayjs().format("YYYY-MM-DD 23:59:59"));
              const start = new Date(dayjs().format("YYYY-MM-DD 00:00:00"));
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 3);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近一周",
            onClick(picker) {
              const end = new Date(dayjs().format("YYYY-MM-DD 23:59:59"));
              const start = new Date(dayjs().format("YYYY-MM-DD 00:00:00"));
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近一个月",
            onClick(picker) {
              const end = new Date(dayjs().format("YYYY-MM-DD 23:59:59"));
              const start = new Date(dayjs().format("YYYY-MM-DD 00:00:00"));
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
              picker.$emit("pick", [start, end]);
            },
          },
        ],
      },
    },
  },
  {
    label: "会员昵称",
    type: "input",
    field: "userName",
  },

  // 订单类型：0:在线下单 1:后台下单 2:同行导出 3:APP端 4:公众号下单

  {
    type: "select",
    field: "source",
    label: "订单类型",
    optionsKey: "label",
    optionsValue: "value",
    options: [
      {
        label: "在线下单",
        value: 0,
      },
      {
        label: "后台下单",
        value: 1,
      },
      {
        label: "同行导出",
        value: 2,
      },
      {
        label: "APP端",
        value: 3,
      },
      {
        label: "公众号下单",
        value: 4,
      },
    ],
  },
  {
    label: "店铺",
    type: "select",
    field: "ownedStore",
    optionsKey: "shopName",
    optionsValue: "shopName",
    options: store.state.custom_dict.shop,
  },

  {
    label: "是否按月统计",
    type: "select",
    field: "monthlyStatistics",
    optionsKey: "label",
    optionsValue: "value",
    options: [
      {
        label: "是",
        value: 1,
      },
      {
        label: "否",
        value: 0,
      },
    ],
  },
];

export const tableBase = [
  {
    label: "日期",
    prop: "orderDate",
    width: "200",
  },
  {
    label: "订单数量",
    prop: "orderCount",
    width: "200",
  },
  {
    label: "快递数量",
    prop: "packageCount",
    width: "200",
  },
  {
    label: "费用",
    prop: "dueFee",
    width: "200",
  },
  {
    label: "积分",
    prop: "points",
    width: "200",
  },
  {
    label: "重量",
    prop: "chargingWeight",
    width: "200",
  },
  {
    label: "按月统计",
    type: "select",
    field: "monthlyStatistics",
    optionsKey: "label",
    optionsValue: "value",
    options: [
      {
        label: "是",
        value: 1,
      },
      {
        label: "否",
        value: 0,
      },
    ],
  },
];

export const tableBase2 = [
  {
    label: "订单号",
    prop: "orderNo",
    width: "300",
  },
  {
    label: "店铺",
    prop: "shopName",
    width: "200",
  },
  {
    label: "订单类型",
    prop: "source",
    width: "200",
  },
  {
    label: "订单时间",
    prop: "orderDate",
    width: "200",
  },
  {
    label: "费用",
    prop: "dueFee",
    width: "200",
  },
  {
    label: "会员",
    prop: "userName",
    width: "200",
  },
  {
    label: "运费",
    prop: "shippingFee",
    width: "200",
  },
  {
    label: "重量",
    prop: "chargingWeight",
    width: "200",
  },
  {
    label: "积分",
    prop: "points",
    width: "200",
  },
];
